#!/bin/sh
#
# /etc/rc.d/mpd: start/stop Music Player Daemon (mpd)
#

export MPD_HOST=localhost
export MPD_PORT=6600

case $1 in
start)
	/usr/bin/mpd
	(
	    mpc random on
	    mpc volume 35
	    mpc crossfade 1
	    mpc repeat on
	) > /dev/null
	;;
stop)
	killall -q /usr/bin/mpd
	;;
restart)
	$0 stop
	sleep 2
	$0 start
	;;
*)
	echo "usage: $0 [start|stop|restart]"
	;;
esac

# End of file
